package com.concurrent.sample.common.util;

import java.io.Serializable;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.id.IdentifierGenerator;

public class IdGenerator implements IdentifierGenerator {

    SnowflakeIdGenerator snowflakeIdGenerator = new SnowflakeIdGenerator(10L, 10L);

    @Override
    public Serializable generate(SharedSessionContractImplementor session, Object object) {
        return snowflakeIdGenerator.generateId();
    }

}